#include "../Hdr/DbgLog.h"
#include "../Hdr/Globals.h"
#include <iostream>
#include <stdarg.h>

Eternal::DbgLog *Eternal::DbgLog::myInstance = new Eternal::DbgLog();

Eternal::DbgLog::DbgLog()
{
	file.open("dbg.txt");
}

Eternal::DbgLog::~DbgLog()
{
	file.close();
}

Eternal::DbgLog *Eternal::DbgLog::GetInstance()
{
	return myInstance;
}

void Eternal::DbgLog::Print(const char *str, ...)
{	
	va_list arg;
	va_start(arg, str);
	vsprintf(c_Buffer, str, arg);
	va_end(arg);
	
	std::cout << c_Buffer << std::endl;
	file << c_Buffer << std::endl;
}